import request from '@/utils/request/index.js'
var app = getApp();
// 获取附近商家
export function apiGetNearbyStores(data) {
	return request.request({
		url: '/api/store/v1/nearbylist',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 商家列表
export function apiEsStoreList(data) {
	return request.request({
		url: '/api/es/v1/store/list',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 测试手机登录
export function MobileLogin(data) {
	return request.request({
		url: '/api/user/v1/pushers/login',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 测试手机登录
export function SendMobileCode(data) {
	return request.request({
		url: '/api/sms/v1/send/captcha',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 获取有店的区域
export function apiGetAreaList(data) {
	return request.request({
		url: '/api/store/v1/city/county/list',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 获取附近商家人气排序
export function apiGetHotStore(data) {
	return request.request({
		url: '/api/store/v1/hotbylst',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 商家详情 
export function apiGetStoreDetail(data) {
	return request.request({
		url: '/api/store/v1/detail',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 用户信息 /api/v1/user/userinfo
export function apiGetUserInfo(data) {
	return request.request({
		url: '/api/v1/user/userinfo',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 用户登陆获取手机号
export function GetLoginMobile(data) {
	return request.request({
		url: '/api/user/v1/wx/minilogin/phone',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}


// 用户登陆
export function UserLogin(data) {
	return request.request({
		url: '/api/user/v1/wx/minilogin',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 获取社区排名
export function RankList(data) {
	return request.request({
		url: '/api/store/v1/appointment/rank',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 小程序首次登录更新用户信息
export function UserInfoUpDate(data) {
	return request.request({
		url: '/api/user/v1/wx/minilogin/userinfo',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 上传
export function GetAliyunToken(data) {
	return request.request({
		url: '/api/aliyunoss/v1/token/mini',// /api/aliyunoss/v1/token
		method: 'GET',
		data: data,
		authType: 'None'
	})
}

// 根据id获取用户信息
export function GetOtherUserInfo(data) {
	return request.request({
		url: '/api/user/v1/invite/userinfo',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 判断绑定关系
export function IsInvite(data) {
	return request.request({
		url: '/api/v1/user/bindStatus',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 获取商家商品列表
export function GetGoodsList(data) {
	return request.request({
		url: '/api/store/v1/goods/list',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 购买商品详情
export function GetGoodsDetail(data) {
	return request.request({
		url: '/api/store/v1/goods/',
		data: data,
		method: 'GET',
		authType: 'None'
	})
}

// 购买商品
export function BuyGoods(data) {
	return request.request({
		url: '/api/order/v1/goods/buy',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 购买商品订单列表
export function GoodsOrderList(data) {
	return request.request({
		url: '/api/order/v1/goods/list',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 商品 退款
export function GoodsRefund(data) {
	return request.request({
		url: '/api/order/v1/goods/cancel',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 重新支付 再次拉起支付
export function PayAgain(data) {
	return request.request({
		url: '/api/order/v1/goods/repear',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 删除购买订单
export function RemoveGoods(data) {
	return request.request({
		url: '/api/order/v1/goods/remove',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 添加购买订单评论
export function AddGoodsComment(data) {
	return request.request({
		url: '/api/order/v1/goods/comment/add',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 请求
export function httpRequest(data) {
	return request.request({
		url: data.url,
		data: data.parms,
		method: data.method,
		authType: 'None'
	})
}

// 添加购买订单评论
export function UpDateUserinfo(data) {
	return request.request({
		url: '/api/v1/user/update',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 添加活动评论
export function AddActivityComment(data) {
	return request.request({
		url: '/api/platform/v1/activity/comment',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 活动评论列表
export function ActivityCommentList(data) {
	return request.request({
		url: '/api/platform/v1/activity/comment/list',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 首页预约信息列表
export function appointmentList(data) {
	return request.request({
		url: '/api/store/v1/appointmentList',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}


// 订单列表 代金券
export function orderGoodsList(data) {
	return request.request({
		url: '/api/order/v1/goods/list',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 积分商品订单列表
// export function productOrderList(data) {
// 	return request.request({
// 		url: '/api/platform/v1/points/product/order/list',
// 		data: data,
// 		method: 'POST',
// 		authType: 'None'
// 	})
// }

// 自用
export function productOrderuse(data) {
	return request.request({
		url: '/api/platform/v1/points/product/order/use',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 转卖详情
export function productOrderUseInfo(data) {
	return request.request({
		url: '/api/platform/v1/points/product/order/useInfo',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}


// 购买转卖的积分商品
export function productBuy(data) {
	return request.request({
		url: '/api/order/v1/points/product/buy',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}








// 订单代金券详情
export function goodsDetail(data) {
	return request.request({
		url: '/api/order/v1/goods/detail',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 商品退款
export function pointsGoodsCancel(data) {
	return request.request({
		url: '/api/order/v1/goods/cancel',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}


// 权益页面信息
export function purchasePage(data) {
	return request.request({
		url: '/api/v1/user/purchasePage',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}



// 秒杀列表
export function getSecKillList(data) {
	return request.request({
		url: '/api/order/v1/secKill/list',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 用户拉新接口
export function getInviteLatest(data) {
	return request.request({
		url: '/api/v1/user/invite/latest',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

//判断是否是新用户还是老用户
export function getShareInvitePage(data) {
	return request.request({
		url: '/api/v1/user/shareInvitePage',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}



// 获取美食列表
export function getStoreFoodList(data) {
	return request.request({
		url: '/api/store/v1/getFoodList',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 获取美食规格
export function getStoreFoodSpec(data) {
	return request.request({
		url: '/api/store/v1/getFoodSpec',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 买单
export function getOrderWikewxBuy(data) {
	return request.request({
		url: '/api/order/v1/wike/wxBuy',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}


// 订单信息
export function getOrderWikeDetail(data) {
	return request.request({
		url: '/api/order/v1/wike/detail',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}


export function getStoreActivityDetail(data) {
	return request.request({
		url: '/api/order/v1/store/activity',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}


// 卡券订单
export function getOrderWikeList(data) {
	return request.request({
		url: '/api/order/v1/wike/list',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 买单列表
export function getOrderuserList(data) {
	return request.request({
		url: '/api/order/v1/user/list',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}


// 用户折扣信息
export function getIUserDiscount(data) {
	return request.request({
		url: '/api/order/v1/user/discount',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

//买单
export function getIUserPay(data) {
	return request.request({
		url: '/api/order/v1/user/pay',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}



//抢红包
export function getWalletRob(data) {
	return request.request({
		url: '/api/v1/users/wallet/rob',
		data: data,
		method: 'GET',
		authType: 'None'
	})
}
// 获取钱包信息
export function getWalletDetail(data) {
	return request.request({
		url: '/api/v1/users/wallet/detail',
		data: data,
		method: 'GET',
		authType: 'None'
	})
}


// 获取钱包收支信息
export function getWalletLog(data) {
	return request.request({
		url: '/api/v1/users/wallet/log',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}


// 是否可以抢红包
export function getWalletIsRob(data) {
	return request.request({
		url: '/api/v1/users/wallet/is/rob',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}




//根据卡号查询银行
export function GetBankInfoApi(data) {
	return request.request({
		url: '/api/v1/users/wallet/card/bankInfo',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

//绑定银行卡
export function GetBindBankCardApi(data) {
	return request.request({
		url: '/api/v1/users/wallet/card/bind',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}


// 获取银行卡信息
export function GetWalletInfoApi(data) {
	return request.request({
		url: '/api/v1/users/wallet/card/detail',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 用户提现
export function GetWithdrawApi(data) {
	return request.request({
		url: '/api/v1/users/wallet/withdrawal',
		data: data,
		method: 'POST',
		authType: 'None'
	})
}

// 推荐商家
export function apiRecommendList(data) {
	return request.request({
		url: '/api/store/v1/recommend/list',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

//订单详情
export function apiorderUserDetail(data) {
	return request.request({
		url: '/api/order/v1/user/detail',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}


// 埋点接口
export function apiEmbeddingPointAdd(data) {
	return request.request({
		url: '/api/user/v1/embedding/point/add',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

//免单区域
export function apiEsFree(data) {
	return request.request({
		url: '/api/es/v1/free',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

//用户领取红包
export function redEvenlopeOpen(data) {
	return request.request({
		url: '/api/v1/users/wallet/redEvenlope/open',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 团购活动红包弹窗
export function redEnvelopePopup(data) {
	return request.request({
		url: '/api/order/v1/groupBuyActivity/redEnvelopePopup',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 红包信息
export function redEnvelopeDetail(data) {
	return request.request({
		url: '/api/v1/users/wallet/redEvenlope/detail ',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}


// 积分判断是否领取
export function userPointsStatus(data) {
	return request.request({
		url: '/api/v1/user/points/status',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 积分领取
export function userPoints(data) {
	return request.request({
		url: '/api/v1/user/points',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}



// 竞列表 
export function auctionInstanceList(data) {
	return request.request({
		url: '/api/auction/v1/instance/list',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}


// 分类列表
export function getCategorySelect(data) {
	return request.request({
		url: '/api/auction/v1/category/select',
		data: data,
		method: 'GET',
		authType: 'None'
	})
}

// 竞商品详情
export function auctionInstanceDetail(data) {
	return request.request({
		url: `/api/auction/v1/instance/detail/${data.id}`,
		data: data,
		method: 'GET',
		authType: 'None'
	})
}

// 立即预约
export function auctionReserve(data) {
	return request.request({
		url: '/api/auction/v1/reserve',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 竞
export function auctionBid(data) {
	return request.request({
		url: '/api/auction/v1/bid',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 竞排名
export function auctionBidRank(data) {
	return request.request({
		url: `/api/auction/v1/bid/rank/${data.id}`,
		data: data,
		method: 'GET',
		authType: 'None'
	})
}


// 卡片统计
export function cardStatistics(data) {
	return request.request({
		url: `/api/user/v1/card/statistics`,
		data: data,
		method: 'GET',
		authType: 'None'
	})
}

// 免单券使用记录
export function cardUseRecord(data) {
	return request.request({
		url: '/api/user/v1/card/useRecord',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}



// 用户领券
export function userReceiveCoupon(data) {
	return request.request({
		url: '/api/v1/user/receive/coupon',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 用户领券状态
export function userReceiveCouponStatus(data) {
	return request.request({
		url: '/api/v1/user/receive/coupon/status',
		method: 'GET',
		data: data,
		authType: 'None'
	})
}


// 开放买
export function userAuctionStatus(data) {
	return request.request({
		url: '/api/v1/user/auctionStatus',
		method: 'GET',
		data: data,
		authType: 'None'
	})
}


// 今日拍品
export function userInstanceToday(data) {
	return request.request({
		url: '/api/auction/v1/instance/today',
		method: 'GET',
		data: data,
		authType: 'None'
	})
}

// 新推荐列表
export function recommendBaseList(data) {
	return request.request({
		url: '/api/store/v1/recommend/baseList',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}



// 拍卖开始订阅
export function auctionStartSubscribe(data) {
	return request.request({
		url: '/api/auction/v1/auction_start_subscribe',
		method: 'POST',
		data: data,
		authType: 'None'
	})
}

// 获取商品分类下拉列表
export function GetGoodsCategory(data) {
	return request.request({
		url: '/api/product/category',
		data: data,
		method: 'GET',
		authType: 'None'
	})
}